package create_创建型.abstract_factory_pattern_抽象工厂模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/03/14:53
 * @Description:
 */
public class ColorFactory extends AbstractFactory {
	public Color getColor(String color) {
		if (color != null) {
			if (color.equalsIgnoreCase("red")) {
				return new Red();
			}
			if (color.equalsIgnoreCase("blue")) {
				return new Blue();
			}
			if (color.equalsIgnoreCase("green")) {
				return new Green();
			}
		}
		return null;
	}

	public Shape getShape(String color) {
		return null;
	}
}
